﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using yiCommerce.Core;
using yiCommerce.Core.Domain.Customers;

namespace yiCommerce.Controllers
{
    public class SharedController : Controller
    {


        private IWorkContext _workContext;

        public SharedController(IWorkContext workContext)
        {
            _workContext = workContext;
        }

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult LoginPartial()
        {
            ViewBag.UserId = _workContext.CurrentCustomer.Id;
            ViewBag.IsAdmin = _workContext.CurrentCustomer.IsAdmin();
            ViewBag.IsShopOwner = _workContext.CurrentCustomer.IsShopOwner();
            return View("_LoginPartial");
        }

        public ActionResult AdminMenu()
        {

            ViewBag.UserId = _workContext.CurrentCustomer.Id;
            ViewBag.IsAdmin = _workContext.CurrentCustomer.IsAdmin();
            ViewBag.IsShopOwner = _workContext.CurrentCustomer.IsShopOwner();
            return View();
        }


        public ActionResult Menu()
        {
            ViewBag.UserId = _workContext.CurrentCustomer.Id;
            ViewBag.IsAdmin = _workContext.CurrentCustomer.IsAdmin();
            ViewBag.IsShopOwner = _workContext.CurrentCustomer.IsShopOwner();
            return View();
        }
    }
}
